package org.example.factoryMethod.HumanFactory;

public class HumanFactory extends AbstractHumanFactory{
    @Override
    public <T extends Human> T createHuman(Class<T> c) {
        //定义生产一个人种
        Human human=null;
        try {
            human = (T)Class.forName(c.getName()).newInstance();
        }catch (Exception e){
            System.out.println("人种生成错误");
        }
        return (T) human;
    }
}
